﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var currentTime=DateTime.Now;
            Console.WriteLine(currentTime.ToString("yyyy-MM-dd hh:mm:ss"));
            Console.WriteLine(currentTime.Date);
            var SecondDate = "2020-10-19";
            var sdate = Convert.ToDateTime(SecondDate);
            var oneDate = sdate.AddDays(-2);
            Console.WriteLine(oneDate);
            var ruan = new DateTime(2021, 10, 19);
            var can = ruan - currentTime;
            Console.WriteLine(can);
            Console.WriteLine(can.TotalSeconds);



            var str1 = "我的王国";
            Console.WriteLine(str1.Length);
            var indexStr = str1.IndexOf("我的");
            Console.WriteLine(indexStr);
            Console.WriteLine(str1.IndexOf("123"));
            var str2 = str1.Insert(4, "我的王国王国123");
            Console.WriteLine(str2);
            Console.WriteLine("字符串字数:" + str1.Length);
            var str = "我的联盟 联盟";
            Console.WriteLine(str);
            var come = str.Trim(' ');
            Console.WriteLine(come);
            int asd = str.IndexOf("阿萨德");
            Console.WriteLine(str.Remove(asd+1,3).Trim());
            var str3 = "123321";
            var str4 = "1234567";
            Console.WriteLine(str3.PadLeft(5));
            Console.WriteLine(str4);
        }
    }
}
